<template>
  <div>
    <el-table :data="tableData" border stripe >
      <el-table-column type="selection" width="55"></el-table-column>
      <el-table-column prop="id" label="编号" width="55"></el-table-column>
      <el-table-column label="流程名称" width="100">审签流程</el-table-column>
      <el-table-column label="案号" prop="num" ></el-table-column>
      <el-table-column prop="courtName" label="所属法院" ></el-table-column>
      <el-table-column prop="createTime" label="发起时间"></el-table-column>
      <el-table-column label="启动/暂停" prop="start" align="center">
        <template v-slot="scope">
            <el-switch
                    v-model="scope.row.start"
                    active-color="#13ce66"
                    inactive-color="#ff4949"
                    active-text="启动"
                    inactive-text="暂停"
                    active-value="Y"
                    inactive-value='N'>
            </el-switch>
        </template>
      </el-table-column>
    </el-table>
    <div style="padding: 10px 0">
      <el-pagination
          background
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="pageNum"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total">
      </el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  name: "workManager",
  data(){
    return {
      tableData: [],
      total: 0,
      pageNum: 1,
      pageSize: 10,
    }
  },
  created() {
    // 请求分页查询数据
    this.load()
  },
  methods:{
    load() {
      this.request.get("/process/getWorkManager",{
        params:{
          pageNum: this.pageNum,
          pageSize: this.pageSize,
        }
      }).then(res => {
        console.log("========")
        console.log(res)
        this.tableData = res.data.list
        this.total = res.data.total
      })
    },
    handleSizeChange(pageSize) {
      console.log(pageSize)
      this.pageSize = pageSize
      this.load()
    },
    handleCurrentChange(pageNum) {
      console.log(pageNum)
      this.pageNum = pageNum
      this.load()
    }
  }

}
</script>

<style>
.headerBg {
  background: #eee!important;
}
</style>
